package com.kaigejava.rulesengine.engine.dto;

/**
 * @author kaigejava
 **/
public enum RuleTypeEnum {
    GENERAL(1,"普通值"),
    TIME(2,"时间值"),
    /**
     * 大数据
     */
    UNIT(3,"积分值乘以课次数量"),
    /**
     * pushevent
     */
    PERCENTAGE(4,"积分百分比");

    private int type;
    private String name;
    RuleTypeEnum(int type,String name){
        this.type = type;
        this.name = name;
    }

    /**
     * 根据枚举值获取枚举对象
     * @param type
     * @return
     */
    public static RuleTypeEnum getRuleTypeEnumByOptionType(int type){
        for(RuleTypeEnum operationEnum : RuleTypeEnum.values()){
            if(operationEnum.getType()==type){
                return operationEnum;
            }
        }
        return null;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
